package net.qhzw.geologr5.gis.service.system.controller;

import net.qhzw.geologr5.gis.common.framework.utils.JsonResult;
import net.qhzw.geologr5.gis.service.system.entity.Project;
import net.qhzw.geologr5.gis.service.system.query.ProjectItemQuery;
import net.qhzw.geologr5.gis.service.system.service.ProjectItemService;
import net.qhzw.geologr5.gis.service.system.vo.project.ProjectRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/***
 * 项目列表前端控制器
 */

@RestController
@RequestMapping("projectItem")
public class ProjectItemController {

    @Autowired
    private ProjectItemService projectItemService;

    /***
     * 创建项目
     * @param projectRequest
     * @return
     */
    @PostMapping("create")
    public JsonResult create(@RequestBody ProjectRequest projectRequest){
        return projectItemService.create(projectRequest);
    }


    /***
     * 查询项目
     * @param query
     * @return
     */
    @GetMapping("find")
    public JsonResult find(ProjectItemQuery query){
        JsonResult result = projectItemService.find(query);
        return result;
    }

    /***
     * 删除项目
     * @param ids
     * @return
     */
    @DeleteMapping("delete/{ids}")
    public JsonResult delete(@PathVariable Integer[] ids){
        return projectItemService.delete(ids);
    }


    /***
     * 查询项目
     * @param query
     * @return
     */
    @GetMapping("findProject")
    public JsonResult findProject(ProjectItemQuery query){
        return projectItemService.findProject(query);
    }



}
